/*
 * @Descripttion:
 * @Author: caijj
 * @Date: 2021-03-18 16:07:24
 * @LastEditors: caijj
 * @LastEditTime: 2021-03-19 10:18:54
 */
import { getRetailStorage, setRetailStorage, removeRetailStorage } from '@/utils/sessionStorage/retail';

const state = {
  parentForm: getRetailStorage()
};

const mutations = {
  SETPARENTFORM: (state, form) => {
    state.parentForm = form;
  }
};

const actions = {
  setParentForm({ commit }, { params, callback }) {
    setRetailStorage(params);
    commit('SETPARENTFORM', params);
    callback();
  },
  clearParentForm() {
    removeRetailStorage();
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions
};
